package org.msfj.hospital.api;

import com.github.pagehelper.PageInfo;
import org.msfj.common.model.CommonResult;
import org.msfj.hospital.service.HospitalNewsService;
import org.msfj.hospital.vo.HospitalNewsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 医院新闻接口
 * @User: Administrator
 * @Date: 2018/8/19 0019
 */
@RestController
@RequestMapping("api/hospital")
public class HospitalNewsApiController {
    @Autowired
    HospitalNewsService hospitalNewsService;

    /**
     * 根据vo查询医院新闻列表
     *
     * @param hospitalNewsVo
     * @param page
     * @param rows
     * @return
     */
    @GetMapping("/listHospitalNewsByVo")
    public CommonResult<PageInfo<HospitalNewsVo>> listHospitalDeptByVo(HospitalNewsVo hospitalNewsVo, Integer page, Integer rows) {
        PageInfo<HospitalNewsVo> byHospitalNews = hospitalNewsService.getByHospitalNews(hospitalNewsVo, page, rows);
        return CommonResult.ok(byHospitalNews);
    }
}
